package com.cqeec.demo.config;

import com.cqeec.demo.entity.Cat;
import com.cqeec.demo.entity.Person;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
// @Configuration告诉spring 这是一个配置类
@Configuration
public class PersonConfig {
    @Bean("zs")
    public Person zs() {
        return new Person("zhuangsan",12,1);
    }
    @Bean("cat")
    public Cat cat(){
        Cat cat=new Cat();
        cat.setAge(3);
        cat.setName("加菲猫");
        cat.setType("猫");
        return cat;
    }
}